package com.runen.infinitemovement.model.api;

import com.runen.infinitemovement.Constant;
import com.runen.infinitemovement.base.BaseAPI;
import com.runen.infinitemovement.model.base.BaseResponseEntity;
import com.runen.infinitemovement.model.entity.AssociatesActivitesEntity;
import com.runen.infinitemovement.model.entity.CollageDetailsEntity;
import com.runen.infinitemovement.model.entity.CollageInfoEntity;
import com.runen.infinitemovement.model.entity.ColumnEntity;
import com.runen.infinitemovement.model.entity.CommentInfoEntity;
import com.runen.infinitemovement.model.entity.CompanyCircleEntity;
import com.runen.infinitemovement.model.entity.DynamicsDetailsEntuty;
import com.runen.infinitemovement.model.entity.DynamicsListEntity;
import com.runen.infinitemovement.model.entity.EnterActiviEntity;
import com.runen.infinitemovement.model.entity.MyEnterActivityies;
import com.runen.infinitemovement.model.entity.MyLongMarchCommentEntity;
import com.runen.infinitemovement.model.entity.NewsEntity;
import com.runen.infinitemovement.model.entity.RecommendActivityEntity;
import com.runen.infinitemovement.model.entity.RerverLikeEntity;
import com.runen.infinitemovement.model.entity.SecondCommentReplyEntity;
import com.runen.infinitemovement.model.entity.SubjectTypeEntity;
import com.runen.rxnetlibrary.net.callback.BaseResultCallback;

import java.util.Map;

public class ActivityAPI extends BaseAPI {
    /**
     * 获取关联活动信息
     *
     * @param callback
     */
    public void getAssociatedActivity(BaseResultCallback<AssociatesActivitesEntity> callback) {
        get(Constant.GET_ASSOCIATED_ACTIVITY_ACTION, null, callback);
    }

    /**
     * 获取我参与的活动和我发布的活动
     *
     * @param callback
     */
    public void getMyEnterOrPublishActivity(String string, int flag, BaseResultCallback<MyEnterActivityies> callback) {
        get(flag == 0 ? Constant.GET_MY_ENTER_ACTIVITY_ACTION + string : Constant.GET_MY_PUBLISH_ACTIVITY_ACTION, null, callback);
    }

    /**
     * 和正在参与的活动
     *
     * @param
     * @param callback
     */
    public void getEnterActivity(BaseResultCallback<EnterActiviEntity> callback) {
        get(Constant.ENTERTING_ACTIVIYI_ACTION, null, callback);
    }

    /**
     * 推荐活动
     *
     * @param callback
     */
    public void getRecommend(BaseResultCallback<RecommendActivityEntity> callback) {
        get(Constant.RECOMMEND_ACTIVITY_ACTION, null, callback);
    }

    /**
     * 获取长征学院资讯列表
     *
     * @param flag
     * @param callback
     */
    public void getCollageInfo(String flag, BaseResultCallback<CollageInfoEntity> callback) {
        get(Constant.GET_COLLAGE_INFO_ACTION + flag, null, callback);
    }

    /**
     * 获取我的长征路学院信息
     *
     * @param string
     * @param callback
     */
    public void getMyLongCollageInfo(String string, BaseResultCallback<CollageInfoEntity> callback) {
        get(Constant.GET_MY_COLLAGE_ACTION + string, null, callback);
    }

    /**
     * 获取我的动态列表信息系
     *
     * @param string
     * @param callback
     */
    public void getMyDynamicsList(String string, BaseResultCallback<DynamicsListEntity> callback) {
        get(Constant.GET_MY_DYNAMICS_LIST_ACTION + string, null, callback);
    }

    /**
     * 发布动态
     *
     * @param string
     * @param callback
     */
    public void publishDynamics(String string, BaseResultCallback<BaseResponseEntity<?>> callback) {
        postBody(Constant.PUBLISH_DYNAMICS_ACTION, string, callback);
    }

    /**
     * 获取公司全信息
     *
     * @param str
     * @param callback
     */
    public void getCompanyCircle(String str, BaseResultCallback<CompanyCircleEntity> callback) {
        get(Constant.GET_COMPANY_CIRCLE_ACTION + str, null, callback);
    }

    /**
     * 动态详情
     *
     * @param str
     * @param callback
     */
    public void onDynamicStateDetails(String str, BaseResultCallback<DynamicsDetailsEntuty> callback) {
        get(Constant.DYNAMICS_DETAILS_ACTION + str, null, callback);
    }

    /**
     * 删除我的动态
     *
     * @param str
     * @param callback
     */
    public void onDelete(String str, BaseResultCallback<BaseResponseEntity<?>> callback) {
        postBody(Constant.DELETE_DYNAMICS_ACTION, str, callback);
    }


    /**
     * 获取收到的点赞数列表
     *
     * @param string
     * @param callback
     */
    public void getReceiveLikedList(String string, int flag, BaseResultCallback<RerverLikeEntity> callback) {
        get(flag == 0 ? Constant.GET_RECEVE_LIKED_ACTION + string : Constant.ZA_GET_RECEVE_LIKED_ACTION + string, null, callback);
    }

    /***
     * 动态点赞
     * @param str
     * @param isLike
     * @param listener
     */
    public void onPraise(String str, boolean isLike, BaseResultCallback<BaseResponseEntity<?>> listener) {
        postBody(isLike ? Constant.PRAISE_ACTION : Constant.CANCEL_PRAISE_ACTION, str, listener);
    }

    /**
     * 对文章的评论或者对某条信息评论
     *
     * @param str
     * @param listener
     */
    public void onDynamicComment(String str, BaseResultCallback<BaseResponseEntity<?>> listener) {
        postBody(Constant.DYNAMIC_COMMENT_ACTION, str, listener);
    }

    /**
     * 二级评论性情列表
     *
     * @param str
     * @param listener
     */
    public void secondComment(String str, BaseResultCallback<SecondCommentReplyEntity> listener) {
        get(Constant.SECOND_COMMENT_REPLY_ACTION + str, null, listener);
    }

    /**
     * 获取评论相关信息
     *
     * @param str
     * @param callback
     */
    public void CommentInfo(String str, BaseResultCallback<CommentInfoEntity> callback) {
        get(Constant.COMMENT_INFO_ACTION + str, null, callback);
    }

    /**
     * 评论点赞或者取消点赞
     *
     * @param isLke
     * @param string
     * @param callback
     */
    public void commentLikeAndCancel(boolean isLke, String string, BaseResultCallback<BaseResponseEntity<?>> callback) {
        postBody(isLke ? Constant.COMMENT_LIKED_ACTION : Constant.COMMENT_CANCEL_LIKE_ACTION, string, callback);
    }

    /**
     * 资讯评论点赞
     *
     * @param isLke
     * @param string
     * @param callback
     */
    public void zxCommentLikeAndCancel(boolean isLke, String string, BaseResultCallback<BaseResponseEntity<?>> callback) {
        postBody(isLke ? Constant.ZA_COMMENT_LIKED_ACTION : Constant.ZA_COMMENT_CANCEL_LIKE_ACTION, string, callback);
    }

    /**
     * 用户点赞和取消点赞
     *
     * @param isLke
     * @param string
     * @param callback
     */
    public void userAddOrCancelLike(boolean isLke, String string, BaseResultCallback<BaseResponseEntity<?>> callback) {
        postBody(isLke ? Constant.USER_LIKE : Constant.USER_CANCEL_LIKE, string, callback);
    }

    /**
     * 获取学院详情
     *
     * @param string
     * @param callback
     */
    public void getCollageDetails(String string, BaseResultCallback<CollageDetailsEntity> callback) {
        get(Constant.GRT_COLLAGE_DETAILS_ACTION + string, null, callback);
    }

    /**
     * 获取我的长征路的评论留言
     *
     * @param string
     * @param callback
     */
    public void getMyLongMarchComment(String string, BaseResultCallback<MyLongMarchCommentEntity> callback) {
        get(Constant.GET_MY_LONG_MARCH_COMMENT_ACTION + string, null, callback);
    }

    /**
     * 获取栏目
     *
     * @param string
     * @param callback
     */
    public void onColumn(String string, BaseResultCallback<ColumnEntity> callback) {
        get(Constant.GET_COLUMN_ACTION + string, null, callback);
    }

    /**
     * 我的长征路点赞和取消点赞
     *
     * @param string
     * @param isLike
     * @param callback
     */
    public void myLongMarchLike(String string, boolean isLike, BaseResultCallback<BaseResponseEntity<?>> callback) {
        postBody(!isLike ? Constant.MY_LONG_MARCH_CANCEL_LIKE_ACTION : Constant.MY_LONG_MARCH_LIKE_ACTION, string, callback);
    }

    /**
     * 新版资讯 首页标题
     *
     * @param callback
     */
    public void subjectType(BaseResultCallback<SubjectTypeEntity> callback) {
        get(Constant.SUBJECT_TYPE, null, callback);
    }

    /**
     * 新版资讯 根据专题id获取资讯列表
     *
     * @param callback
     */
    public void informationListBySubjectId(Map<String, Object> params, BaseResultCallback<NewsEntity> callback) {
        get(Constant.INFORMATION_LIST_BY_SUBJECTID, params, callback);
    }

    /**
     * 获取我的长征路的评论留言
     *
     * @param string
     * @param callback
     */
    public void getMyLongMarchCommentV2(String string, BaseResultCallback<MyLongMarchCommentEntity> callback) {
        get(Constant.LONG_MARCH_EXAM + string, null, callback);
    }
}
